home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / gfx / 3d / irit50src.lha / irit5 / include / ln_sweep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  1.4 KB  |  45 lines

  1. /*******************************************************************************
  2. * Line plane sweep algorithm implementation - header file.               *
  3. *                                           *
  4. * Written by:  Gershon Elber                              Ver 1.0, June 1993   *
  5. *******************************************************************************/
  6.  
  7. #ifndef LN_SWEEP_H
  8. #define LN_SWEEP_H
  9.  
  10. #include "irit_sm.h"
  11.  
  12. typedef RealType LsPoint[3];      /* The Z component is pretty much ignored. */
  13.  
  14. typedef struct LsLineSegStruct {
  15.     struct LsLineSegStruct *Pnext;
  16.     LsPoint Pts[2];
  17.     long Id;                /* Lines with unique ID never intersect. */
  18.     VoidPtr PAux;        /* Auxiliary backpointer - not used by ln_sweep. */
  19.     struct LsIntersectStruct *Inters;
  20.     LsPoint _MinVals;                     /* Bounding box on the line */
  21.     LsPoint _MaxVals;
  22.     LsPoint _Vec;             /* A vector from first point to second. */
  23.     RealType _ABC[3];                /* Line equation as Ax + By + C. */
  24. } LsLineSegStruct;
  25.  
  26. typedef struct LsIntersectStruct {
  27.     struct LsIntersectStruct *Pnext;
  28.     RealType t;
  29.     RealType OtherT;
  30.     struct LsLineSegStruct *OtherSeg;
  31.     long Id;                       /* Unique ID of intersection. */
  32. } LsIntersectStruct;
  33.  
  34. #if defined(__cplusplus) || defined(c_plusplus)
  35. extern "C" {
  36. #endif
  37.  
  38. void LineSweep(LsLineSegStruct **Lines);
  39.  
  40. #if defined(__cplusplus) || defined(c_plusplus)
  41. }
  42. #endif
  43.  
  44. #endif /* LN_SWEEP_H */
  45.